package com.hzsun.spring.component;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.stereotype.Component;

import java.util.Iterator;

/**
 * @Author: DingJl
 * @Date: 2022/1/18 9:58
 * @Version 1.0
 */
@Component
public class BeanFactoryPostProcessorExpand implements BeanFactoryPostProcessor {
    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory configurableListableBeanFactory) throws BeansException {
        System.out.println("/*************/");
        System.out.println("/****BeanFactoryPostProcessorExpand***/");
        System.out.println("/*************/");
        Iterator<String> beanNamesIterator = configurableListableBeanFactory.getBeanNamesIterator();
        while (beanNamesIterator.hasNext()){
            String next = beanNamesIterator.next();
            System.out.println("BeanName=>"+next);
        }

    }
}
